package com.itheima.controller;

import com.itheima.config.SpringConfig;
import com.itheima.domain.Book;
import com.itheima.service.BookService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfig.class)
public class BookServiceText {

    @Autowired
    private BookService bookService;

//    @Test
//    public void textById() {
//        Book byId = bookService.getById(1);
//        System.out.println(byId);
//    }

    @Test
    public void textGetAll() {
        List<Book> all = bookService.getAll();
        System.out.println(all);
    }

}
